<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    const  age=12;
    const name="lucy";
    //传统方式定义对象
    const p1={name:name,age:age};
    console.log(p1);

    //es6写法
    const p2={name,age};
    console.log(p2)
</script>
</html>